﻿@using Citi.GocAttributes.Domain
@using Citi.GocAttributes.WebUI.Models
@model IEnumerable<RuleResultModel>
<table cellpadding="1">
    @foreach (var type in Enum.GetValues(typeof(DatabaseEnums.TypeResultType)).Cast<DatabaseEnums.TypeResultType>())
    {
        if ((int)type % 2 == 0)
        {
        <text><tr></text>
        }
            <td style="padding-left: 7px; padding-right: 7px;">
                <b>@type.GetDescription():</b>
            </td>
            <td>
                @{
                    var selectedValue = Model.FirstOrDefault(x=> x.TypeRuleResult.Type == type);
                    
                    @Html.DropDownList(string.Concat("Value", type),
                               ((IEnumerable<TypeRuleResultModel>)ViewBag.TypeRuleResults)
                               .Where(x => x.Type == type).ToSelectList(x => x.Value, x => x.Id.ToString(), selectedValue != null ? selectedValue.TypeRuleResultId.ToString() : null ),
                               "-", new { style = "width:155px;" })
                }
            </td>
    }
</table>
